﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebCommit.Web.Models;
using WebCommit.Common.Models;
using WebCommit.Common.Entitys;
using WebCommit.Common.Helpers;
using WebCommit.Common.Mvc.Filters;
using WebCommit.Common.Interfaces;
using WebCommit.Common.Factories;
using WebCommit.Common.Mvc.BaseClass;

namespace WebCommit.Web.Controllers
{
    public class CommitController : BaseController
    {
        //
        // GET: /Commit/
		//[CheckLogin]
        public ActionResult Title(TitleRequest request)
        {
			//if (string.IsNullOrEmpty(request.Url))
			//{
			//    request.Url = Request.ServerVariables["Http_Referer"];
			//}
			ICommitSvc svc = SvcFactory.GetInstance<ICommitSvc>();
			request.UserId = LoginUser != null ? LoginUser.Id : "";

			TitleResponse response = svc.ResolveTitle(request);

			return View(response);
        }

    }
}
